// 这个模块主要获取的是品牌属性的数据模块
import request from '@/utils/request'

// 获取一级分类  /admin/product/getCategory1  get
export const reqLevel1CategoryList = (id) => {
  return request({ url: '/admin/product/getCategory1', method: 'get' })
}

// 获取二级分类  /admin/product/getCategory2/{category1Id}  get
export const reqLevel2CategoryList = (category1Id) => {
  return request({ url: `/admin/product/getCategory2/${category1Id}`, method: 'get' })
}

// 获取三级分类  /admin/product/getCategory3/{category1Id}  get
export const reqLevel3CategoryList = (category2Id) => {
  return request({ url: `/admin/product/getCategory3/${category2Id}`, method: 'get' })
}

// 获取平台属性接口 /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} get
export const reqAttrInfoList = (category1Id, category2Id, category3Id) => {
  return request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: 'get' })
}
// 添加新的属性名和属性值接口   /admin/product/saveAttrInfo  post
/* {
  "attrName": "string",
  "attrValueList": [
    {
      "attrId": 0,
      "id": 0,
      "valueName": "string"
    }
  ],
  "categoryId": 0,
  "categoryLevel": 0,
  "id": 0
} */
export const reqSaveAttrInfo = (data) => {
  return request({ url: '/admin/product/saveAttrInfo', method: 'post', data })
}
